package com.gopay.common.domain.cps.vo;

import com.gopay.common.domain.cps.CpsGenMainOrder;
import com.gopay.common.domain.cps.CpsGenManageOrder;
import com.gopay.common.util.DateUtils;

/**
 * 
 * 收款类订单
 * 
 * 现在订单分父子表，应为父子表必须同时完成动作，所以放在Manager中进行事务实现
 * 
 * @FullCpsGenRecvOrder.java
 * @author MA HUAN
 * @2012-12-29 下午10:03:53 www.gopay.com.cn Inc.All rights reserved.
 */
public class FullCpsGenManageOrder extends CpsGenOrder{

    private static final long serialVersionUID = -5672665662560804482L;
    
    //子表属性
    private String subRemark1;
    private String subRemark2;
    private String refundChannel; 
    public FullCpsGenManageOrder() {
         
    }
    
    public FullCpsGenManageOrder(CpsGenMainOrder main, CpsGenManageOrder manage) {
        setGopayOrderId(main.getGopayOrderId());
        setTransDtlSq(main.getTransDtlSq());
        setGopayIntTxnCd(main.getGopayIntTxnCd());
        setMerId(main.getMerId());
        setMerOrderId(main.getMerOrderId());
        setMerTxnTm(main.getMerTxnTm());
        setGatewaySource(main.getGatewaySource());
        setGatewayChannel(main.getGatewayChannel());
        setOrderType(main.getOrderType());
        setPayChannel(main.getPayChannel());
        setGopayTxnTm(main.getGopayTxnTm());
        setRelevanceGopayOrderId(main.getRelevanceGopayOrderId());
        setTotalOrderAmt(main.getTotalOrderAmt());
        setTotalOrderFeeAmt(main.getTotalOrderFeeAmt());
        setOrderDealAmt(main.getOrderDealAmt());
        setOrderRealFeeAmt(main.getOrderRealFeeAmt());
        setOrderFeePayer(main.getOrderFeePayer());
        setCurType(main.getCurType());
        setMainRecvAcct(main.getMainRecvAcct());
        setMainRecvAcctProdCode(main.getMainRecvAcctProdCode());
        setMainRecvAcctProdName(main.getMainRecvAcctProdName());
        setMainRecvCustId(main.getMainRecvCustId());
        setPayAcct(main.getPayAcct());
        setMainPayAcctProdCode(main.getMainPayAcctProdCode());
        setMainPayAcctProdName(main.getMainPayAcctProdName());
        setPayCustId(main.getPayCustId());
        setTxnStaCd(main.getTxnStaCd());
        setOutStlmId(main.getOutStlmId());
        setOutPayAcct(main.getOutPayAcct());
        setTranFinishTime(main.getTranFinishTime());
        setOrderStlmTime(main.getOrderStlmTime());
        setLastUpdTrancode(main.getLastUpdTrancode());
        setRemark1(main.getRemark1());
        setRemark2(main.getRemark2());
        setMerTxnAmt(main.getMerTxnAmt());
        setUserId(main.getUserId());
        setReversalFlag(main.getReversalFlag());
        
        setAccountPoint(main.getAccountPoint());
        //系统加固 结算金额 zhg.zhang 20160712
        setSettleAmt(main.getSettleAmt());
        setOtherAcct(main.getOtherAcct());
        this.subRemark1 = manage.getRemark1();
        this.subRemark2 = manage.getRemark2();
        this.refundChannel=manage.getRefundChannel();
    }
    
    public CpsGenMainOrder getCpsGenMainOrder() {
        CpsGenMainOrder main = new CpsGenMainOrder();
        
        main.setGopayOrderId(getGopayOrderId());
        main.setTransDtlSq(getTransDtlSq());
        main.setGopayIntTxnCd(getGopayIntTxnCd());
        main.setMerId(getMerId());
        main.setMerOrderId(getMerOrderId());
        main.setMerTxnTm(getMerTxnTm());
        main.setGatewaySource(getGatewaySource());
        main.setGatewayChannel(getGatewayChannel());
        main.setOrderType(getOrderType());
        main.setPayChannel(getPayChannel());
        main.setGopayTxnTm(getGopayTxnTm());
        main.setRelevanceGopayOrderId(getRelevanceGopayOrderId());
        main.setTotalOrderAmt(getTotalOrderAmt());
        main.setTotalOrderFeeAmt(getTotalOrderFeeAmt());
        main.setOrderDealAmt(getOrderDealAmt());
        main.setOrderRealFeeAmt(getOrderRealFeeAmt());
        main.setOrderFeePayer(getOrderFeePayer());
        main.setCurType(getCurType());
        main.setMainRecvAcct(getMainRecvAcct());
        main.setMainRecvAcctProdCode(getMainRecvAcctProdCode());
        main.setMainRecvAcctProdName(getMainRecvAcctProdName());
        main.setMainRecvCustId(getMainRecvCustId());
        main.setPayAcct(getPayAcct());
        main.setMainPayAcctProdCode(getMainPayAcctProdCode());
        main.setMainPayAcctProdName(getMainPayAcctProdName());
        main.setPayCustId(getPayCustId());
        main.setTxnStaCd(getTxnStaCd());
        main.setOutStlmId(getOutStlmId());
        main.setOutPayAcct(getOutPayAcct());
        main.setTranFinishTime(getTranFinishTime());
        main.setOrderStlmTime(getOrderStlmTime());
        main.setCreatedTs(DateUtils.getSystemDate());
        main.setLastUpdTs(DateUtils.getSystemDate());
        main.setLastUpdTrancode(getLastUpdTrancode());
        main.setRemark1(getRemark1());
        main.setRemark2(getRemark2());
        main.setMerTxnAmt(getMerTxnAmt());
        main.setUserId(getUserId());
        main.setReversalFlag(getReversalFlag());
        //记账点
        main.setAccountPoint(this.getAccountPoint());
        
        //系统加固 结算金额 zhg.zhang 20160712
        main.setSettleAmt(getSettleAmt());
        main.setOtherAcct(getOtherAcct());
        
        return main;
    }
    
    public CpsGenManageOrder getCpsGenManageOrder() {
        CpsGenManageOrder manage = new CpsGenManageOrder();
        manage.setGopayOrderId(getGopayOrderId());
        manage.setCreatedTs(DateUtils.getSystemDate());
        manage.setLastUpdTs(DateUtils.getSystemDate());
        manage.setLastUpdTrancode(getLastUpdTrancode());
        manage.setRemark1(subRemark1);
        manage.setRemark2(subRemark2);
        manage.setRefundChannel(refundChannel);
        return manage;
    }


    public String getSubRemark1() {
        return subRemark1;
    }

    public void setSubRemark1(String subRemark1) {
        this.subRemark1 = subRemark1;
    }

    public String getSubRemark2() {
        return subRemark2;
    }

    public void setSubRemark2(String subRemark2) {
        this.subRemark2 = subRemark2;
    }
}
